<?php $this->headScript()
->captureStart()?>
$(document).ready(function(){
   $(".del_menu").click(function(){
    	if (confirm('<?php echo $this->translate('Determined to remove it?')?>')) {
	    	var id = $(this).attr('id').substr(2);
	    	var par = $(this).parent();
	    	$.getJSON('<?php echo  $this->route('delmenu')?>/id/'+id,function(data){
	    		if (data.success==1)  {
				//location.reload();
				par.remove();
			}

	    	});
    	}
    });
 });
<?php $this->headScript()->captureEnd()?>

<?php $this->headStyle()->captureStart()?>
<?php echo $this->render('css/kind-style.css')?>
<?php $this->headStyle()->captureEnd()?>
<div id="kindManager">
<fieldset>
   <legend><?php echo $this->translate('Add Category')?></legend>
<form action="" method="post" id="kindFrom">
<?php echo $this->form->title?>
<?php echo $this->form->parent_id?>
<?php echo $this->form->published?>
<?php echo $this->form->addgroup?>
</form>
</fieldset>

<fieldset>
   <legend><?php echo $this->translate('Category List')?></legend>
   <?php foreach ($this->moduleList as $row): ?>
  	<p>
  	<?php if (@$this->resChild[$row['resource_id']]==0):?>
  	<?php echo $row['title']?>&nbsp; 	<span class="del_menu" id="d-<?php echo $row['id']?>"><?php echo $this->translate('Delete')?></span>
  	<?php else:?>
  	<a href="<?php echo $this->route('list','manager')?>/id/<?php echo $row['resource_id']?>"><?php echo $row['title']?></a>
  	<?php endif?>
  	</p>
	<?php endforeach; ?>

</fieldset>

</div>
<div style="clear:both" ></div>
